#region License Revision: 0 Last Revised: 6/18/2008 11:00 AM
/******************************************************************************
Copyright (c) Microsoft Corporation.  All rights reserved.


This file is licensed under the Microsoft Public License (Ms-PL). A copy of the Ms-PL should accompany this file. 
If it does not, you can obtain a copy from: 

http://www.microsoft.com/resources/sharedsource/licensingbasics/publiclicense.mspx
******************************************************************************/
#endregion // License
using System;
using System.Windows.Browser;
using System.Diagnostics;
using System.Text;
using ScriptInterop;
using System.Globalization;

namespace VIEWS // Virtual Earth Wrapper
{
    /// <summary>
    /// Contains the shape objects and location of a pushpin cluster.
    /// </summary>
	public class VEClusterSpecification : JSObject
	{
		/// <summary>
        /// Contains the options for customizing a pushpin cluster display.
        /// </summary>
		private static string thisClass = "VEClusterSpecification";
		
		/// <summary>
        /// Get the JavaScript class name
        /// </summary>
		/// <returns type="String">
        /// The class name used in JavaScript
        /// </returns>		
		public override string ClassName
		{
			get { return thisClass; }
		}

        #region Constructors
        /// <summary>Construct a C# wrapper from a ScriptObject</summary>
        public VEClusterSpecification(ScriptObject so) : base(so) { }

        /// <summary>Initializes a new instance of the VEClusterSpecification Class.</summary>
        public VEClusterSpecification()
        { ScriptObject = CreateClass(); }

        #endregion // Constructors

        #region Public Methods
        /// <summary>
        /// Returns a <see cref="VEShape"/> that represents the pushpin cluster.
        /// </summary>
        /// <returns>
        /// A <see cref="VEShape"/> representing the pushpin cluster. Returns <see langword="null"/> if a 
        /// <see cref="VEClusterSpecification"/> object was returned from the VEShapeLayer.GetClusteredShapes 
        /// Method.
        /// </returns>
        public VEShape GetClusterShape()
        {
            object result = Invoke("GetClusterShape");
            return VEShape.GetShapeObject(result as ScriptObject);
        }
        #endregion // Public Methods

        #region Public Properties
        /// <summary>
        /// Gets an array of <see cref="VEShape"/> items representing the pushpins in a pushpin cluster.
        /// </summary>
        /// <value>
        /// An array of <see cref="VEShape"/> items representing the pushpins in a pushpin cluster.
        /// </value>
        public VEShape[] Shapes
        {
            get { return VEShape.ConvertShapeArray(GetProperty<ScriptObject>("Shapes")); }
        }

        /// <summary>
        /// Gets a <see cref="VELatLong"/> indicating the center of the pushpin cluster.
        /// </summary>
        /// <value>
        /// A <see cref="VELatLong"/> indicating the center of the pushpin cluster.
        /// </value>
        public VELatLong LatLong
        {
            get { return GetProperty<VELatLong>("LatLong"); }
        }
        #endregion // Public Properties
	};
}
